<?php

namespace frontend\modules\activity\controllers;

use Yii;
use frontend\components\Controller;
use frontend\modules\activity\models\HotDashboardLogic;
use frontend\modules\activity\models\HotProductSearch;
use frontend\modules\activity\models\AssembleProductSearch;

/**
 * 热销榜
 * 
 * @author emhome <emhome@163.com>
 * @since 1.0
 */
class HotController extends Controller {

    /**
     * @inheritdoc
     */
    protected function verbs() {
        return [
            '*' => ['GET'],
        ];
    }

    /**
     * 热销榜
     * @inheritdoc
     */
    public function actionIndex() {
        $model = new HotDashboardLogic();
        return $model->toArray();
    }

    /**
     * 精选活动商品列表
     * @inheritdoc
     */
    public function actionList() {
        $model = new AssembleProductSearch();
        $model->load(Yii::$app->request->getQueryParams(), '');
        $model->tag = 'hot';
        return $model->search();
    }

}
